<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>我的金币</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/DDMBase.js"></script>
<link rel="stylesheet" href="${path }/resource/weixin/css/recharge.css">
</head>
<body>
	<!-- 头部 -->
	<jsp:include page="_top.jsp"></jsp:include>
	<!-- 会员头像与名字 -->
	<div class="margin-1 back-w padding-1">
		<img class="am-circle vip-img" src="${user.photo }">&nbsp;&nbsp;
		<span>${user.name }</span>
	</div>
	<!-- 会员余额 -->
	<div class=" ">
		<div data-am-widget="tabs" class="am-tabs am-tabs-d2">
			<ul class="am-tabs-nav am-cf">
				<li class=""><a href="[data-tab-panel-0]">推广送金币</a></li>
				<li class="am-active"><a href="[data-tab-panel-1]">余额</a></li>
			</ul>
			<div class="am-tabs-bd">
				<div data-tab-panel-0 class="am-tab-panel back-w">
					<div id="tgsjb"></div>
					<br>
					<br>
					<br>
					<br>
				</div>
				<div data-tab-panel-1 class="am-tab-panel am-active back-w">
					<div class="float-l color-9">
						<span class="">可用金币:<span class="color-y">${user.age}</span></span><br>
					</div>
					<a href="${path }/customer/redirect/jbcz"
						class="float-r pay-btn color-w back-y">立即充值</a> <br> <br>
					<br> <br> <br>
				</div>
			</div>
		</div>
	</div>
	<!-- 温馨提醒 -->
	<div class="margin-1 back-w padding-1 color-9">
		<span class="">温馨提示:</span><br> <span id="wxts"></span><br>
	</div>
	<div class="margin-10  padding-10  color-9">
		<span>想在家掌柜获得更多推广效果!&nbsp;请拨打</span>&nbsp;<i
			class="am-icon-phone color-y"></i>&nbsp;<a id="tgdh" class="color-y"></a>
	</div>


	<script type="text/javascript">
		$(function() {

			setArtToPage("推广送金币", "tgsjb")
			setArtToPage("推广电话", "tgdh")
			setArtToPage("温馨提示", "wxts")
			wx.config({
				debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
				appId : '${appId}', // 必填，公众号的唯一标识
				timestamp : '${timestamp}', // 必填，生成签名的时间戳
				nonceStr : '${noncestr}', // 必填，生成签名的随机串
				signature : '${signature}',// 必填，签名，见附录1
				jsApiList : [ 'onMenuShareTimeline', 'onMenuShareAppMessage',
						'onMenuShareQQ', 'onMenuShareQZone' ]
			// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
			});

		})

		function setArtToPage(name, id) {
			$.AjaxProxy({
				p : {
					title : name
				}
			}).invoke("${path}/visitor/article/findByName", function(loj) {
				var html = loj.getValue("mapInfo").art.content;
				$("#" + id).html(html);
			});
		}

		wx.ready(function() {
			//alert('执行成功！');
		});
		wx.error(function(res) {
			//	alert('执行失败'+JSON.stringify(res));
		});

		wx.onMenuShareTimeline({
			title : '买房、卖房、租房房子的事情就找房掌柜！上房掌柜找房子省心！注册送豪礼！',
			desc : '锑都商讯0中介费，注册就送金币哦，点我马上获取海量房源信息！',
			link : '${url}', // 分享链接
			imgUrl : '${path}/resource/images/logo.png', // 分享图标
			success : function() {
				alert('分享成功！')
			},
			cancel : function() {
				// alert('分享失败！')
			}
		});
		wx.onMenuShareAppMessage({
			title : '买房、卖房、租房房子的事情就找房掌柜！上房掌柜找房子省心！注册送豪礼！',
			desc : '${user.name}对您分享了锑都商讯',  
			link : '${url}', // 分享链接
			imgUrl : "${path}/resource/images/logo.png", // 分享图标
			success : function() {
			},
			cancel : function() {
			}
		});
		
	</script>
</body>

</html>